package com.czkj.hwz.decorate.base;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import org.xutils.x;

/**
 * Created by wyouflf on 15/11/4.
 */
public class BaseActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        x.view().inject(this);
    }


    protected void toOtherActivity(Class activity) {
        Intent intent = new Intent(this,activity);
        startActivity(intent);
    }
    protected void toOtherActivity(Bundle bundle,Class activity) {
        Intent intent = new Intent(this,activity);
        intent.putExtras(bundle);
        startActivity(intent);
    }
    protected void toStartService(Class activity){
        Intent intent = new Intent(this,activity);
        intent.setAction("start");
        startService(intent);
    }
    protected void toDestroyService(Class activity){
        Intent intent = new Intent(this,activity);
        intent.setAction("destroy");
        startService(intent);
    }
}
